import service from "@/service"
import qs from "qs"

//登录接口
export function login (data) {
  return service({
    method: 'post',
    url: '/login',
    data
  })
}

// 获取学生列表接口
export function students (params) {
  return service({
    methods: "get",
    url: '/students',
    params
  })
}

// 删除学生接口
export function studentDel (id) {
  return service({
    method: 'delete',
    url: `/students/${id}`
  })
}

// 获取学生列表接口
export function studentInfo (params) {
  return service({
    method: 'get',
    url: '/info',
    params
  })
}

// 添加&修改学生信息接口
export function info (type, data) {
  data = qs.stringify(data)
  let obj = { method: type, url: '/info', data }
  return service(obj)
}

export function delInfo (id) {
  return service({
    method: 'delete',
    url: `/info/${id}`
  })
}

// 获取数据概览
export function dataView () {
  return service({
    method: 'get',
    url: '/dataview'
  })
}

// 获取地图散点api
export function travelMap () {
  return service({
    method: 'get',
    url: '/travel'
  })
}
